3.5.31 \(\int (a+b \log (c (d (e+f x)^p)^q))^2 \, dx\) [431]

Optimal. Leaf size=78 \[ -2 a b p q x+2 b^2 p^2 q^2 x-\frac {2 b^2 p q (e+f x) \log \left (c \left (d (e+f x)^p\right )^q\right )}{f}+\frac {(e+f x) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{f} \]

[Out]

-2*a*b*p*q*x+2*b^2*p^2*q^2*x-2*b^2*p*q*(f*x+e)*ln(c*(d*(f*x+e)^p)^q)/f+(f*x+e)*(a+b*ln(c*(d*(f*x+e)^p)^q))^2/f

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2436, 2333, 2332, 2495} \begin {gather*} \frac {(e+f x) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{f}-2 a b p q x-\frac {2 b^2 p q (e+f x) \log \left (c \left (d (e+f x)^p\right )^q\right )}{f}+2 b^2 p^2 q^2 x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Log[c*(d*(e + f*x)^p)^q])^2,x]

[Out]

-2*a*b*p*q*x + 2*b^2*p^2*q^2*x - (2*b^2*p*q*(e + f*x)*Log[c*(d*(e + f*x)^p)^q])/f + ((e + f*x)*(a + b*Log[c*(d
*(e + f*x)^p)^q])^2)/f

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2436

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2495

Int[((a_.) + Log[(c_.)*((d_.)*((e_.) + (f_.)*(x_))^(m_.))^(n_)]*(b_.))^(p_.)*(u_.), x_Symbol] :> Subst[Int[u*(
a + b*Log[c*d^n*(e + f*x)^(m*n)])^p, x], c*d^n*(e + f*x)^(m*n), c*(d*(e + f*x)^m)^n] /; FreeQ[{a, b, c, d, e,
f, m, n, p}, x] &&  !IntegerQ[n] &&  !(EqQ[d, 1] && EqQ[m, 1]) && IntegralFreeQ[IntHide[u*(a + b*Log[c*d^n*(e
+ f*x)^(m*n)])^p, x]]

Rubi steps

\begin {align*} \int \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2 \, dx &=\text {Subst}\left (\int \left (a+b \log \left (c d^q (e+f x)^{p q}\right )\right )^2 \, dx,c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right )\\ &=\text {Subst}\left (\frac {\text {Subst}\left (\int \left (a+b \log \left (c d^q x^{p q}\right )\right )^2 \, dx,x,e+f x\right )}{f},c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right )\\ &=\frac {(e+f x) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{f}-\text {Subst}\left (\frac {(2 b p q) \text {Subst}\left (\int \left (a+b \log \left (c d^q x^{p q}\right )\right ) \, dx,x,e+f x\right )}{f},c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right )\\ &=-2 a b p q x+\frac {(e+f x) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{f}-\text {Subst}\left (\frac {\left (2 b^2 p q\right ) \text {Subst}\left (\int \log \left (c d^q x^{p q}\right ) \, dx,x,e+f x\right )}{f},c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right )\\ &=-2 a b p q x+2 b^2 p^2 q^2 x-\frac {2 b^2 p q (e+f x) \log \left (c \left (d (e+f x)^p\right )^q\right )}{f}+\frac {(e+f x) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 69, normalized size = 0.88 \begin {gather*} \frac {(e+f x) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{f}-2 b p q \left (a x-b p q x+\frac {b (e+f x) \log \left (c \left (d (e+f x)^p\right )^q\right )}{f}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Log[c*(d*(e + f*x)^p)^q])^2,x]

[Out]

((e + f*x)*(a + b*Log[c*(d*(e + f*x)^p)^q])^2)/f - 2*b*p*q*(a*x - b*p*q*x + (b*(e + f*x)*Log[c*(d*(e + f*x)^p)
^q])/f)

________________________________________________________________________________________

Maple [F]
time = 0.03, size = 0, normalized size = 0.00 \[\int \left (a +b \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right )\right )^{2}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*ln(c*(d*(f*x+e)^p)^q))^2,x)

[Out]

int((a+b*ln(c*(d*(f*x+e)^p)^q))^2,x)

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 159, normalized size = 2.04 \begin {gather*} -2 \, a b f p q {\left (\frac {x}{f} - \frac {e \log \left (f x + e\right )}{f^{2}}\right )} + b^{2} x \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right )^{2} + 2 \, a b x \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) - {\left (2 \, f p q {\left (\frac {x}{f} - \frac {e \log \left (f x + e\right )}{f^{2}}\right )} \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + \frac {{\left (e \log \left (f x + e\right )^{2} - 2 \, f x + 2 \, e \log \left (f x + e\right )\right )} p^{2} q^{2}}{f}\right )} b^{2} + a^{2} x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*(d*(f*x+e)^p)^q))^2,x, algorithm="maxima")

[Out]

-2*a*b*f*p*q*(x/f - e*log(f*x + e)/f^2) + b^2*x*log(((f*x + e)^p*d)^q*c)^2 + 2*a*b*x*log(((f*x + e)^p*d)^q*c)
- (2*f*p*q*(x/f - e*log(f*x + e)/f^2)*log(((f*x + e)^p*d)^q*c) + (e*log(f*x + e)^2 - 2*f*x + 2*e*log(f*x + e))
*p^2*q^2/f)*b^2 + a^2*x

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 238 vs. \(2 (82) = 164\).
time = 0.35, size = 238, normalized size = 3.05 \begin {gather*} \frac {b^{2} f q^{2} x \log \left (d\right )^{2} + b^{2} f x \log \left (c\right )^{2} + {\left (b^{2} f p^{2} q^{2} x + b^{2} p^{2} q^{2} e\right )} \log \left (f x + e\right )^{2} - 2 \, {\left (b^{2} f p q - a b f\right )} x \log \left (c\right ) + {\left (2 \, b^{2} f p^{2} q^{2} - 2 \, a b f p q + a^{2} f\right )} x - 2 \, {\left ({\left (b^{2} f p^{2} q^{2} - a b f p q\right )} x + {\left (b^{2} p^{2} q^{2} - a b p q\right )} e - {\left (b^{2} f p q x + b^{2} p q e\right )} \log \left (c\right ) - {\left (b^{2} f p q^{2} x + b^{2} p q^{2} e\right )} \log \left (d\right )\right )} \log \left (f x + e\right ) + 2 \, {\left (b^{2} f q x \log \left (c\right ) - {\left (b^{2} f p q^{2} - a b f q\right )} x\right )} \log \left (d\right )}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*(d*(f*x+e)^p)^q))^2,x, algorithm="fricas")

[Out]

(b^2*f*q^2*x*log(d)^2 + b^2*f*x*log(c)^2 + (b^2*f*p^2*q^2*x + b^2*p^2*q^2*e)*log(f*x + e)^2 - 2*(b^2*f*p*q - a
*b*f)*x*log(c) + (2*b^2*f*p^2*q^2 - 2*a*b*f*p*q + a^2*f)*x - 2*((b^2*f*p^2*q^2 - a*b*f*p*q)*x + (b^2*p^2*q^2 -
 a*b*p*q)*e - (b^2*f*p*q*x + b^2*p*q*e)*log(c) - (b^2*f*p*q^2*x + b^2*p*q^2*e)*log(d))*log(f*x + e) + 2*(b^2*f
*q*x*log(c) - (b^2*f*p*q^2 - a*b*f*q)*x)*log(d))/f

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 178 vs. \(2 (76) = 152\).
time = 0.56, size = 178, normalized size = 2.28 \begin {gather*} \begin {cases} a^{2} x + \frac {2 a b e \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{f} - 2 a b p q x + 2 a b x \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )} - \frac {2 b^{2} e p q \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{f} + \frac {b^{2} e \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}^{2}}{f} + 2 b^{2} p^{2} q^{2} x - 2 b^{2} p q x \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )} + b^{2} x \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}^{2} & \text {for}\: f \neq 0 \\x \left (a + b \log {\left (c \left (d e^{p}\right )^{q} \right )}\right )^{2} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*ln(c*(d*(f*x+e)**p)**q))**2,x)

[Out]

Piecewise((a**2*x + 2*a*b*e*log(c*(d*(e + f*x)**p)**q)/f - 2*a*b*p*q*x + 2*a*b*x*log(c*(d*(e + f*x)**p)**q) -
2*b**2*e*p*q*log(c*(d*(e + f*x)**p)**q)/f + b**2*e*log(c*(d*(e + f*x)**p)**q)**2/f + 2*b**2*p**2*q**2*x - 2*b*
*2*p*q*x*log(c*(d*(e + f*x)**p)**q) + b**2*x*log(c*(d*(e + f*x)**p)**q)**2, Ne(f, 0)), (x*(a + b*log(c*(d*e**p
)**q))**2, True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 303 vs. \(2 (82) = 164\).
time = 5.90, size = 303, normalized size = 3.88 \begin {gather*} \frac {{\left (f x + e\right )} b^{2} p^{2} q^{2} \log \left (f x + e\right )^{2}}{f} - \frac {2 \, {\left (f x + e\right )} b^{2} p^{2} q^{2} \log \left (f x + e\right )}{f} + \frac {2 \, {\left (f x + e\right )} b^{2} p q^{2} \log \left (f x + e\right ) \log \left (d\right )}{f} + \frac {2 \, {\left (f x + e\right )} b^{2} p^{2} q^{2}}{f} + \frac {2 \, {\left (f x + e\right )} b^{2} p q \log \left (f x + e\right ) \log \left (c\right )}{f} - \frac {2 \, {\left (f x + e\right )} b^{2} p q^{2} \log \left (d\right )}{f} + \frac {{\left (f x + e\right )} b^{2} q^{2} \log \left (d\right )^{2}}{f} + \frac {2 \, {\left (f x + e\right )} a b p q \log \left (f x + e\right )}{f} - \frac {2 \, {\left (f x + e\right )} b^{2} p q \log \left (c\right )}{f} + \frac {2 \, {\left (f x + e\right )} b^{2} q \log \left (c\right ) \log \left (d\right )}{f} - \frac {2 \, {\left (f x + e\right )} a b p q}{f} + \frac {{\left (f x + e\right )} b^{2} \log \left (c\right )^{2}}{f} + \frac {2 \, {\left (f x + e\right )} a b q \log \left (d\right )}{f} + \frac {2 \, {\left (f x + e\right )} a b \log \left (c\right )}{f} + \frac {{\left (f x + e\right )} a^{2}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*(d*(f*x+e)^p)^q))^2,x, algorithm="giac")

[Out]

(f*x + e)*b^2*p^2*q^2*log(f*x + e)^2/f - 2*(f*x + e)*b^2*p^2*q^2*log(f*x + e)/f + 2*(f*x + e)*b^2*p*q^2*log(f*
x + e)*log(d)/f + 2*(f*x + e)*b^2*p^2*q^2/f + 2*(f*x + e)*b^2*p*q*log(f*x + e)*log(c)/f - 2*(f*x + e)*b^2*p*q^
2*log(d)/f + (f*x + e)*b^2*q^2*log(d)^2/f + 2*(f*x + e)*a*b*p*q*log(f*x + e)/f - 2*(f*x + e)*b^2*p*q*log(c)/f
+ 2*(f*x + e)*b^2*q*log(c)*log(d)/f - 2*(f*x + e)*a*b*p*q/f + (f*x + e)*b^2*log(c)^2/f + 2*(f*x + e)*a*b*q*log
(d)/f + 2*(f*x + e)*a*b*log(c)/f + (f*x + e)*a^2/f

________________________________________________________________________________________

Mupad [B]
time = 0.30, size = 111, normalized size = 1.42 \begin {gather*} {\ln \left (c\,{\left (d\,{\left (e+f\,x\right )}^p\right )}^q\right )}^2\,\left (b^2\,x+\frac {b^2\,e}{f}\right )+x\,\left (a^2-2\,a\,b\,p\,q+2\,b^2\,p^2\,q^2\right )-\frac {\ln \left (e+f\,x\right )\,\left (2\,b^2\,e\,p^2\,q^2-2\,a\,b\,e\,p\,q\right )}{f}+2\,b\,x\,\ln \left (c\,{\left (d\,{\left (e+f\,x\right )}^p\right )}^q\right )\,\left (a-b\,p\,q\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*log(c*(d*(e + f*x)^p)^q))^2,x)

[Out]

log(c*(d*(e + f*x)^p)^q)^2*(b^2*x + (b^2*e)/f) + x*(a^2 + 2*b^2*p^2*q^2 - 2*a*b*p*q) - (log(e + f*x)*(2*b^2*e*
p^2*q^2 - 2*a*b*e*p*q))/f + 2*b*x*log(c*(d*(e + f*x)^p)^q)*(a - b*p*q)

________________________________________________________________________________________